Define ETL Helper User Defined Functions (UDFs)


In [2]:
def empty_udf_function():
  return True

def is_open_map(col):
  if col == "O":
    return "OPEN"
  else:
    return "FULFILLED"

sqlContext.udf.register("is_open_map", is_open_map)
sqlContext.udf.register("returns_true", empty_udf_function)